﻿@model IEnumerable<CmsSiteWorkflowPanelModel>
@if (Model.Any())
{
    <div><strong>W = in workflow E = Expiry</strong></div>
    <ul class="ul-reset b-sites g-clear">
    @foreach (var site in Model)
    {
        <li class="">
            <span class="b-sites__col b-tooltip-trigger">
                <span class="b-pseudo-link">
                    @if (site.SiteId.HasValue)
                    {
                        <a href="@Url.Action("SwitchSite", "CmsAccount", new { id = site.SiteId })">@site.SiteName</a>   
                    }
                    else
                    {
                        @site.SiteName
                    }
                </span>
                <span class="b-tooltip">
                    <span class="b-tooltip__head">
                        <span class="b-tooltip__title">Items for your attention</span>
                    </span>                    		
                    <span class="b-tooltip__body">
                        @foreach (var state in site.States)
                        {
                            <div>.@state.State W (@state.ActiveCount) E (@state.ExpiredCount)</div>
                        }    
                    </span>
                </span>
            </span>
            <span class="b-sites__col"><strong>W (@site.ActiveCount) </strong></span>
            <span class="b-sites__col"><strong>E (@site.ExpiredCount)</strong></span>
        </li>
    }</ul>
}
else
{
    <div>There are no active items</div>
}